package com.acme.filter;

import java.io.IOException;
import java.util.logging.Logger;

import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;

public class YourNewFilter extends MyGenericFilter implements Filter {

	public void doFilter(final ServletRequest request, final ServletResponse response, FilterChain chain)
	       throws java.io.IOException, javax.servlet.ServletException  { 
	      
		ServletContext context= getServletContext();
//		HttpServletRequest req
		
//		request.getre
//		
//		req.getRequestURL().toString(); // use this method to get the end of the URL
	      RequestDispatcher rd= context.getRequestDispatcher("/index.html");
	      rd.forward(request, response);

	  }

	@Override
	public void destroy() {
	}

	@Override
	public void init(FilterConfig arg0) throws ServletException {
	}
}